package cn.bellychang.decorator.demo01;

/**
 * @author ChangLiang
 * @date 2019/6/19
 */
public abstract class Decorator implements Component {

    private Component decorated;

    public Decorator(Component decorated) {
        this.decorated = decorated;
    }

    /**
     * decorated method
     */
    @Override
    public void methodA() {
        if(decorated!=null) {
            decorated.methodA();
        }
    }
}
